using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Response.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.Tools;

namespace MinimalistFoodStreet.BackEnd.Server.Server.ResponseExtend.Tables 
{
	public static class DictionarysEnitityExtend 
	{
		public static ResponseDictionarysDto ToResponseDto(this Dictionary entity)
		{
			return new ResponseDictionarysDto ()
			{

					id = entity.DId,
					value = entity.DValue,
					dictionaryTypeId = entity.DDictionaryTypeId,
					parentId = entity.DParentId,
					createTime = entity.DCreateTime,
					createTimeStr = Tools.TimeToString(entity.DCreateTime),
					updateTime = entity.DUpdateTime,
					updateTimeStr = Tools.TimeToString(entity.DUpdateTime),
			};
		}
	}
}